home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / boot / netBoot / sun4.md / RCS / globram.h,v < prev    next >
Encoding:
Text File  |  1989-06-19  |  7.5 KB  |  211 lines

  1. head     1.1;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    mendel:1.1; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.1
  10. date     89.06.19.14.23.52;  author mendel;  state Exp;
  11. branches ;
  12. next     ;
  13.  
  14.  
  15. desc
  16. @@
  17.  
  18.  
  19.  
  20. 1.1
  21. log
  22. @Initial revision
  23. @
  24. text
  25. @
  26. /*    @@(#)globram.h 1.10 88/02/08 SMI      */
  27.  
  28. /*
  29.  * Copyright (c) 1986 by Sun Microsystems, Inc.
  30.  */
  31.  
  32. /*
  33.  * globram.h
  34.  *
  35.  * Sun ROM Monitor global data
  36.  *
  37.  * This defines a data structure that lives in low RAM and is
  38.  * used by the ROM monitor for its own purposes.
  39.  *
  40.  * Elements of the structure are accessed by referring to "gp->xxx".
  41.  * "gp" is defined as a small integer coerced to a struct pointer.
  42.  * The compiler and assembler generate short absolute addresses from this.
  43.  */
  44. #ifndef GLOBRAM
  45. #define    GLOBRAM
  46.  
  47. /* FIXME, this whole nested include stuff needs cleanup. */
  48. #include "types.h"
  49. #include "sunromvec.h"
  50. #include "../sun3/sunmon.h"
  51. #include "buserr.h"
  52. #include "asyncbuf.h"
  53. #include "dpy.h"
  54. #include "../sun3/cpu.map.h"
  55. #include "diag.h"
  56. #include "pixrect.h"
  57. #include "memvar.h"
  58. #include "../sun3/cpu.buserr.h"
  59.  
  60. /* Define "keybuf_t" for asynchronous bufferring between nmi routine
  61.    and keyboard handler. */
  62. DEFBUF (keybuf_t, unsigned char, KEYBUFSIZE);
  63.  
  64. struct globram {
  65.     struct buserr_stack_20_common g_bestack;/* Stacked data from 68020 */
  66.     struct buserr_stack_20_extension g_beext;/* More data from 68020 */
  67.     long            g_beregs[17];    /* Regs & usp from last b.e. */
  68.     struct buserrorreg    g_because;    /* What caused the bus error? */
  69.  
  70. /* Fake copies of hardware registers that can't be read or written from C */
  71.     unsigned char        g_leds;        /* LED register, set_leds */
  72.  
  73. /* Miscellaneous services */
  74.     unsigned         g_simm;        /* save bad SIMM module number*/
  75.     int            g_nmiclock;    /* pseudo-clock counter (msec, 
  76.                             bumped by nmi routine) */
  77.     unsigned        g_memorysize;    /* Phys size of mem in bytes */
  78.     unsigned        g_memoryavail;    /* Memory avail to Unix, not
  79.                            including Monitor pages */
  80.     unsigned char        *g_memorybitmap;/* 0 or Ptr to pageavail map */
  81.     unsigned        g_memoryworking;/* Memory that works, including
  82.                            Monitor pages */
  83.     char            *g_nextrawvirt;    /* Next for resalloc() */
  84.     char            *g_nextdmaaddr;    /* Next for resalloc() */
  85.     struct pgmapent        g_nextmainmap;    /* Next physmem to resalloc() */
  86.     long            *g_busbuf;    /* setbus() save area ptr */
  87.     struct diag_state    g_diag_state;    /* Info from powerup diags */
  88.     void            (*g_vector_cmd)(); /* Addr of vector cmd */
  89.  
  90. /* Command line input for monitor */
  91.     unsigned char        g_linebuf[BUFSIZE+2];    /* data input buffer */
  92.     unsigned char        *g_lineptr;    /* next "unseen" char */
  93.     int            g_linesize;    /* size of input line */
  94.     struct bootparam    g_bootparam;    /* Bootstrap parameter block */
  95.  
  96. /* keyboard handling */
  97.     struct zscc_device    *g_keybzscc;    /* UART address */
  98.     unsigned char        g_key;        /* Last up/down code read */
  99.     unsigned char        g_prevkey;    /* The previous reading */
  100.     unsigned char        g_keystate;    /* State machine */
  101.     unsigned char        g_keybid;    /* Id byte supplied */
  102.     struct keybuf_t        g_keybuf[1];    /* Raw up/down code buf */
  103.     unsigned int        g_shiftmask;    /* "shift-like" keys' posns */
  104.     unsigned int        g_translation;    /* Current translation */
  105.     int            g_keyrinit;    /* Rpt timeout (eg 500 ms) */
  106.     int            g_keyrtime;    /* Time of next repeat */
  107.     unsigned char        g_keyrtick;    /* 2nd rpt timeout (eg 30 ms) */
  108.     unsigned char        g_keyrkey;     /* keycode to rpt, or IDLEKEY */
  109.  
  110. /* Console I/O vectoring and such */
  111.     /* Values for g_insource and g_outsink are defined in sunromvec.h */
  112.     struct zscc_device    *g_inzscc;    /* Input UART address */
  113.     struct zscc_device    *g_outzscc;    /* Output UART address */
  114.     unsigned char        g_insource;    /* Current input source */
  115.     unsigned char        g_outsink;    /* Current output sink */
  116.     unsigned char        g_debounce;    /* used to debounce BREAK key */
  117.     unsigned char        g_init_bounce;    /* BREAK key initialization */
  118.     unsigned char        g_loop;        /* Continue on error flag */
  119.     unsigned char        g_echo;        /* input should be echoed? */
  120.     unsigned char        g_fbthere;    /* frame buffer plugged in? */
  121.  
  122. /* Watchdog resets */
  123.     long            g_resetaddr;    /* watchdog jump address */
  124.     long            g_resetaddrcomp;    /* ~g_resetaddr */
  125.     long            g_resetmap;    /* Map entry for g_resetaddr */
  126.     /* g_resetmap is really (struct pgmapent) but you can't do ~ on them. */
  127.     long            g_resetmapcomp;    /* ~g_resetmap */
  128.  
  129. /* Trace and breakpoint */
  130.     short            g_breakval;    /* instruc rplcd by bkpt */
  131.     short            *g_breakaddr;    /* address of current bkpt */
  132.     int            g_breaking;    /* we are resuming at bkpt? */
  133.     int            (*g_tracevec)();/* User's Trace vector */
  134.     unsigned char        *g_tracecmds;    /* string of commands */
  135.     int            (*g_breakvec)();/* User's Trap #1 vector */
  136.     int            (*g_breaktrvec)();/* User's Trace vector */
  137. /* Booting infor */
  138.     short            g_def_seq;    /* using default sequence */
  139.  
  140. /* Terminal emulator */
  141.     struct pixrect        g_fbpr;        /* pixrect for frame buffer */
  142.     struct mpr_data        g_fbdata;    /* mem_raster    ''    */
  143.     struct pr_prpos        g_fbpos;    /* Cur posn in frame buffer */
  144.     struct pixrect        g_charpr;    /* pixrect for char to paint */
  145.     struct mpr_data        g_chardata;    /* mem_raster     ''    */
  146.     struct pr_prpos        g_charpos;    /* Posit info    ''    */
  147.     unsigned short        (*g_font)[CHRSHORTS-1];    /* Font table address */
  148.     int            g_ax;        /* Alpha cursor x posn, chars */
  149.     int            g_ay;        /* Alpha cursor y posn, chars */
  150.     unsigned short        *g_dcax;
  151.     unsigned short        *g_dcay;     /* '' in device coordinates */
  152.     short            g_dcok;        /* device coords current? */
  153.     int            g_escape;    /* next char an escape cmd? */
  154.     int            g_chrfunc;    /* POX func to draw chars */
  155.     int            g_fillfunc;    /* POX func to clear areas */
  156.     int            g_state;    /* ALPHA, SKIPPING, etc */
  157.     int            g_cursor;    /* NOCURSOR or BLOCKCURSOR */
  158.     int            g_ac;        /* last arg in ESCBRKT seq's */
  159.     int            g_ac0;        /* ditto, next-to-last arg */
  160.     int            g_acinit;    /* g_ac with 0 left alone */
  161.     int            g_scrlins;    /* # lines to scroll */
  162.     int            g_gfxmemsize;    /* g_memorysize after shadow */
  163.     int            g_gfxmemsizecomp;    /* ~g_gfxmemsize */
  164.     unsigned         g_scrwidth;    /* Total width in pixels */
  165.     unsigned        g_scrheight;    /* Total height in pixels */
  166.     unsigned        g_wintop;    /* Top   margin of screen */
  167.     unsigned        g_winleft;    /* Left  margin of screen */
  168.     int            g_fbtype;    /* Type, see <sun/fbio.h> */
  169.     int            g_fbused;    /* mono or color */
  170.     int            g_scrsize;    /* screen size code */
  171.     short            g_BWenable;    /* B/W enable plane flag */
  172.     short            g_colorFB;    /* Color frame buffer flag */
  173.     short            g_colorDAC;    /* DAC color map flag */
  174.     char                    g_option;       /* Diagnostic option flag */
  175.         char                    g_Video;        /* Diagnostic video flag */
  176.         int                    Error;          /* Error ,Errors and Feedback*/
  177.         int                    Errors;         /* are used */
  178.         int                    Feedback;       /* in memory tests */
  179.         char                    g_diagecho;     /* Diagnostic echo flag */
  180.         char                    g_sccflag;      /* SCC Port A or Port B flag */
  181.     char            g_echoinput;    /* Input is Kybd or SCC */
  182.     long            g_mod3addr;    /* Error address */
  183.     long            g_mod3exp;    /* Expected Value */
  184.     long            g_mod3obs;    /* Observed Value */
  185.     int             adr_c;        /* Address inc for monitor */
  186.     int                   Modified;    /*Loc Modified flag in montor */
  187.     struct keyboard      *Curr_ktb;    /* Current keytable pointer */
  188.  
  189. /* window specifier */
  190.     unsigned int            g_bottom;          /* number of rows */
  191.     unsigned int            g_top;           /* number of columns  */
  192.     unsigned int            g_left;
  193.     unsigned int            g_right;
  194.     unsigned int            g_winbot;          /* bottom of window */
  195. };
  196.  
  197.  
  198. #define modified gp->Modified 
  199. #define adr_count gp->adr_c 
  200. #define curr_ktb gp->Curr_ktb
  201. #define video gp->g_Video
  202. #define g_error gp->Error
  203. #define g_errors gp->Errors
  204. #define feedbk gp->Feedback
  205.  
  206. #define                gp    ((struct globram *)STRTDATA)
  207.  
  208.  
  209. #endif
  210. @
  211.